/**
 * @(#)LoginType.java, 2018/2/6.
 * <p/>
 * Copyright 2018 Kerr Wang, Inc. All rights reserved.
 * KERRWANG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package org.wangzx.exercise.enums;

/**
 * @author hzwangzuxiang(ahscwzx@163.com)
 */
public enum LoginType implements EnumIntegerInterface<LoginType>{
    UN_LOGIN(0,"未登陆"),
    BUYER(1, "买家登录"),
    SELLER(2, "卖家登录"),
    ;

    private final int value;

    private final String desc;

    LoginType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public LoginType genEnumByIntValue(int intValue) {
        for(LoginType loginType : LoginType.values()) {
            if(loginType.value == intValue) {
                return loginType;
            }
        }
        return UN_LOGIN;
    }
}
